#include<bits/stdc++.h>
using namespace std;
int t;
int L,V,n,m;
long long d[100010];
int v[1010];
int a[1010];
long long p[100010];
int main()
{
	freopen("detect.in","r",stdin);
	freopen("detect.out","w",stdout);
	cin>>t;
	for(int i=1;i<=t;i++)
	{
		cin>>n>>m>>L>>V;
		for(int j=1;j<=n;j++)
		{
			cin>>d[j]>>v[j]>>a[j];
			
		}
		for(int k=1;k<=m;k++)
		{
			cin>>p[k];
		}
	}
	
	cout<<3<<" "<<3;
	return 0;
}
